home *** CD-ROM | disk | FTP | other *** search
Wrap
iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) NNNNAAAAMMMMEEEE iiiiffffllllNNNNIIIITTTTFFFF - NITF file format HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE #include <ifl/iflNITF.h> DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN The Image Format Library (IFL) provides support for reading and writing image files with the National Imagery Transmission Format (NITF), Version 2.0. The format has been designed for transmitting the contents of a briefing boards from one location to another. As such, it contains support for storing both imagery and its annotations. The IFL interface is used to directly access the imagery sections, while the segment interface, described below, is used to access the remaining objects contained within the file. The various objects contained within the NITF file are placed into segments. Each segment is divided into two sections, the header section and the data section. The header section is a collection fields that define how to interpret the data section. The IFL NITF file API provides the ability to create, access or modify each of the various segments within an NITF file. With the exception of specific header fields, most all of the remaining fields are modifiable by the application. A complete listing of all of the available fields within each segment can be found in ////uuuussssrrrr////lllliiiibbbb////iiiiffffllll////iiiiffffllll____nnnniiiittttffffffffoooorrrrmmmmaaaatttt. The field and segment names have been chosen to correspond directly to those found in the NITF specification. Access to the imagery segments is affected via the standard IFL calls. Unlike general NITF file readers, the IFL version requires that the file contain at least one image. Each of the images in the NITF file is accessed as a separate sub-image, with the first image segment being sub-image zero. The remaining segments in the file and the fields of the image segments are accessed via the segment interface described below. Using the iiiiffffllllFFFFiiiilllleeee::::::::ggggeeeettttTTTTaaaagggg() method, file segments can be retrieved or created. The following are the pseudo ggggeeeettttTTTTaaaagggg() declarations that reflect the segment accessors. iflStatus getTag(iflNITFTagId tag, iflNITFSegmentType type, int segNum, iflNITFSegment** seg); PPPPaaaaggggeeee 1111 iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) The following calling sequence is used to retrieve an existing segment. In this example the retrieved segment is a symbol segment. iflNITFSegment* seg; iflStatus sts; sts = file->getTag(iflNITFTagSegment, iflNITFSegSymbol, 0, &seg); The following example shows the creation of a new symbol segment. This sequence is usable for all but image segments, which must be created using the iiiiffffllllFFFFiiiilllleeee::::::::aaaappppppppeeeennnnddddIIIImmmmgggg() or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee() methods. sts = file->getTag(iflNITFTagNewSegement, iflNITFSegSymbol, 1, &seg); With a pointer to an iiiiffffllllNNNNIIIITTTTFFFFSSSSeeeeggggmmmmeeeennnntttt, the application can access the individual fields of the segment header, and read or write the data section of the segment. The following is a list of the iflNITFSegment member functions and their descriptions. ggggeeeettttTTTTyyyyppppeeee(((()))) iflNITFSegmentType getType() const Returns this segment's type. ggggeeeettttNNNNuuuummmm(((()))) int getNum() const Returns the index of this segment within the file. ggggeeeettttFFFFiiiieeeelllldddd(((()))) iflNITFFieldPtr getField(const char* name) Retrieve the field associated with _n_a_m_e. If a matching field cannot be found then _N_U_L_L is returned. PPPPaaaaggggeeee 2222 iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) ggggeeeettttNNNNeeeexxxxttttFFFFiiiieeeelllldddd(((()))) iflNITFFieldPtr getNextField(iflNITFFieldPtr f) Returns the field that immediately follows the field _f. If _f is NULL, then the first field of the segment is returned. If _f points to the last field in the segment, then NULL is returned. ggggeeeettttFFFFiiiieeeellllddddNNNNaaaammmmeeee(((()))) const char* getFieldName(iflNITFFieldPtr f) Returns the name of field _f. ggggeeeettttFFFFiiiieeeellllddddTTTTyyyyppppeeee(((()))) iflNITFFieldType getFieldType(iflNITFFieldPtr f) Returns the field _f type. ggggeeeettttFFFFiiiieeeellllddddWWWWiiiiddddtttthhhh(((()))) size_t getFieldWidth(iflNITFFieldPtr f) Returns the width of the field _f in bytes as it appears in the NITF file. ggggeeeettttFFFFiiiieeeellllddddVVVVaaaalllluuuueeee(((()))) iflStatus getFieldValue(iflNITFFieldPtr f, int32_t& value) iflStatus getFieldValue(iflNITFFieldPtr f, int64_t& value) iflStatus getFieldValue(iflNITFFieldPtr f, float& value) iflStatus getFieldValue(iflNITFFieldPtr f, const char*& value) iflStatus getFieldValue(iflNITFFieldPtr f, const char*& value, size_t& width) Retrieves the value of the field _f into _v_a_l_u_e. If the type of the field does not match the type of _v_a_l_u_e or cannot be promoted, an iflBADPARAMS error is returned. The _w_i_d_t_h parameter will contain the PPPPaaaaggggeeee 3333 iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) field width for byte or string fields. sssseeeettttFFFFiiiieeeellllddddVVVVaaaalllluuuueeee(((()))) iflStatus setFieldValue(iflNITFFieldPtr f, int32_t value) iflStatus setFieldValue(iflNITFFieldPtr f, int64_t value) iflStatus setFieldValue(iflNITFFieldPtr f, float value) iflStatus setFieldValue(iflNITFFieldPtr f, const char* value) iflStatus setFieldValue(iflNITFFieldPtr f, const char* value, size_t width) Sets the value of the field _f to _v_a_l_u_e. If the type of the field does not match the type of _v_a_l_u_e, or the type of _v_a_l_u_e cannot be promoted to the field type, then an iflBADPARAMS error is returned. If the field is read-only, then an iflBADFIELDSET error is returned to the caller. The _w_i_d_t_h parameter specifies the width of the value argument for variable byte length fields. There are currently only two such fields in the format, DESDATA and RESDATA. Attempting to adjust the width of non-variable length fields will result in an iflBADFIELDSET error. ggggeeeettttCCCCoooonnnntttteeeennnnttttLLLLeeeennnnggggtttthhhh(((()))) int64_t getContentLength() const Returns the length of the data section of this segment. rrrreeeeaaaaddddCCCCoooonnnntttteeeennnntttt(((()))) iflStatus readContent(void* buf, size_t bufLen, size_t& rdLen) This function reads the data section of this segment into buffer _b_u_f. The length of the buffer is given by _b_u_f_L_e_n. The actual number of bytes read from the segment is returned in _r_d_L_e_n. Reads of the data section always start at the beginning of the data section. That is, the entire data section can only be retrieved via a single read. wwwwrrrriiiitttteeeeCCCCoooonnnntttteeeennnntttt(((()))) PPPPaaaaggggeeee 4444 iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiiffffllllNNNNIIIITTTTFFFF((((3333)))) iflStatus writeContent(const void* buf, size_t bufLen, size_t& wrLen) This function writes the data section of this segment from the buffer _b_u_f. The amount of data to write from the buffer is given by _b_u_f_L_e_n. The actual number of bytes written to the file is returned in _w_r_L_e_n. In general, the value returned in _w_r_L_e_n should always match _b_u_f_L_e_n. SSSSEEEEEEEE AAAALLLLSSSSOOOO iflFile, iflFormat PPPPaaaaggggeeee 5555